<template>
  <div class="right-search-box">
    <div class="key-select">
      <div class="key-select-label">查询：</div>
      <je-select :v-model:value="micromailValue" :options="micromailOptions" />
    </div>
    <div class="key-person">
      <div class="key-person-label">关键人：</div>
      <je-input
        v-model:value="searchExamine"
        placeholder="搜索"
        autocomplete="false"
        class="left-search-box"
        @change="handleSearch"
      >
        <template #prefix>
          <i class="fal fa-search" style="padding-right: 2px"></i>
        </template>
      </je-input>
    </div>
    <div class="key-date">
      <div class="key-date-label">送交日期：</div>
      <je-range-picker
        v-model:value="rangeDate"
        ge-picker
        :locale="locale"
        :placeholder="['开始日期', '结束日期']"
        :get-popup-container="popupContainer"
        @change="changeRangeDate"
      />
    </div>
  </div>
  <div class="right-content-box">
    <div v-for="i in 15" :key="i" class="right-content-item">
      <div class="right-content-item-top">
        <div class="item-top-left">
          <div class="item-top-photo" v-text="formatName(`齐齐`)"></div>
          <div class="item-top-info">员工工作台任务提醒未读</div>
        </div>
        <div class="item-top-right">今天</div>
      </div>
      <div class="right-content-item-bottom">
        <div class="item-bottom-left">
          <div class="item-bottom-name">齐齐</div>
          <div class="item-bottom-remark">
            <div class="remark-point"></div>
            <div class="remark-info">暂无评论内容</div>
          </div>
        </div>
        <div class="item-bottom-right">
          <div class="bottom-thumb">
            <i class="fal fa-thumbs-up"></i>
            <span>1</span>
          </div>
          <div class="bottom-heart">
            <i class="fal fa-heart"></i>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="page-box">
    <je-pagebar
      :page-size="pageData.limit"
      :total-count="pageData.totalCount"
      @load="loadData"
    ></je-pagebar>
  </div>
</template>

<script>
  import { defineComponent, reactive, toRefs, onBeforeMount, onMounted, ref } from 'vue';
  import { DatePicker } from '@jecloud/ui';
  import locale from 'ant-design-vue/lib/date-picker/locale/zh_CN';
  import { Input, Select } from '@jecloud/ui';
  import JePagebar from '@/components/page-bar.vue';
  export default defineComponent({
    name: 'MicromailSend',
    components: {
      JeRangePicker: DatePicker.RangePicker,
      JeInput: Input,
      JeSelect: Select,
      JePagebar,
    },
    setup() {
      let micromailValue = ref('1');
      const state = reactive({
        micromailOptions: [
          { label: '全部', value: '0' },
          { label: '已读', value: '1' },
          { label: '未读', value: '2' },
          { label: '心标', value: '3' },
        ],
        searchExamine: '',
        rangeDate: null, //自定义时间
        locale,
        pageData: {
          limit: 10,
          totalCount: 30,
        },
      });
      const methods = {
        handleSearch() {},
        popupContainer(triggerNode) {
          return triggerNode.parentNode;
        },
        changeRangeDate() {},
        formatName(name) {
          if (name) {
            return name.slice(name.length - 2);
          }
        },
        handleMark() {},
        loadData() {},
      };
      onBeforeMount(() => {});
      onMounted(() => {});
      return {
        micromailValue,
        ...toRefs(state),
        ...methods,
      };
    },
  });
</script>
<style>
  /* .right-search-box .ant-input-affix-wrapper .ant-input,
  .right-search-box .ant-picker .ant-picker-input input {
    background-color: #f5f5f5;
  } */
  /* .page-box .ant-btn {
    width: 70px;
    height: 26px;
    text-align: center;
    padding: 0;
    color: #333333;
    background: #ffffff;
    border: 1px solid #f5f5f5;
    border-radius: 2px;
    font-size: 14px;
    box-sizing: border-box;
    margin-right: 10px;
  }
  .page-box .movepage .ant-input-number-input {
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    color: #333333;
  } */
  .key-select .ant-select:not(.ant-select-customize-input) .ant-select-selector {
    background-color: #f5f5f5;
    border: 1px solid #f5f5f5;
  }
</style>
<style scoped lang="less">
  .right-search-box {
    width: 100%;
    height: 40px;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #f5f5f5;
    border-left: 1px solid #f5f5f5;
    border-right: 1px solid #f5f5f5;
    display: inline-flex;
    align-items: center;
    .key-select {
      display: inline-flex;
      align-items: center;
      .key-select-label {
        font-size: 14px;
        color: #3f3f3f;
      }
      .ant-select {
        width: 70px;
      }
    }
    .key-person {
      display: inline-flex;
      align-items: center;
      margin-left: 10px;
      .key-person-label {
        font-size: 14px;
        color: #3f3f3f;
      }
      .ant-input-affix-wrapper {
        width: 130px;
        border: 1px solid #f5f5f5;
      }
    }
    .key-date {
      display: inline-flex;
      align-items: center;
      margin-left: 10px;
      .key-date-label {
        font-size: 14px;
        color: #3f3f3f;
      }
      .ant-picker {
        width: 240px;
        background-color: #f5f5f5;
        border: 1px solid #f5f5f5;
      }
    }
  }
  .right-content-box {
    width: 100%;
    height: 600px;
    box-sizing: border-box;
    border-left: 1px solid #f5f5f5;
    border-right: 1px solid #f5f5f5;
    overflow-y: auto;
    .right-content-item {
      width: 100%;
      height: 70px;
      box-sizing: border-box;
      padding: 8px 20px;
      .right-content-item-top {
        width: 100%;
        display: inline-flex;
        justify-content: space-between;
        .item-top-left {
          display: inline-flex;
          .item-top-photo {
            width: 34px;
            height: 34px;
            line-height: 34px;
            background: #faa03a;
            border-radius: 50%;
            font-size: 12px;
            color: #ffffff;
            text-align: center;
            margin: 0 1px;
            flex-shrink: 0;
          }
          .item-top-info {
            height: 20px;
            line-height: 20px;
            font-size: 14px;
            color: #3f3f3f;
            padding-left: 20px;
            // overflow: hidden;
            // white-space: nowrap;
            // text-overflow: ellipsis;
          }
        }
        .item-top-right {
          height: 20px;
          line-height: 20px;
          font-size: 14px;
          color: #a9aba9;
        }
      }
      .right-content-item-bottom {
        width: 100%;
        display: inline-flex;
        justify-content: space-between;
        .item-bottom-left {
          display: inline-flex;
          .item-bottom-name {
            width: 36px;
            height: 18px;
            line-height: 18px;
            font-size: 12px;
            text-align: center;
            color: #a9aba9;
          }
          .item-bottom-remark {
            padding-left: 20px;
            display: inline-flex;
            align-items: center;
            .remark-point {
              width: 6px;
              height: 6px;
              background: #949795;
              border-radius: 50%;
            }
            .remark-info {
              height: 18px;
              line-height: 18px;
              font-size: 12px;
              color: #a9aba9;
              padding-left: 4px;
            }
          }
        }
        .item-bottom-right {
          height: 18px;
          line-height: 18px;
          display: inline-flex;
          color: #a9aba9;
          .bottom-thumb {
            margin-right: 8px;
            i {
              font-size: 14px;
              color: #faa03a;
              cursor: pointer;
            }
            span {
              padding-left: 4px;
              font-size: 12px;
            }
          }
          .bottom-heart {
            color: #a9aba9;
            font-size: 14px;
            cursor: pointer;
          }
        }
      }
    }
    .right-content-item:nth-child(odd) {
      background-color: #ffffff;
    }
    .right-content-item:nth-child(even) {
      background-color: #f5f5f5;
    }
    .right-content-item:hover .right-content-item-top .item-top-info {
      color: #3265f5;
      cursor: pointer;
    }
  }
  .right-content-box::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .page-box {
    width: 100%;
    height: 40px;
    padding: 6px 20px;
    border-left: 1px solid #f5f5f5;
    border-right: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
  }
</style>
